 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKRms/RmsModel.h>

@implementation SendStatus
-(id) initWithPin:(NSString*) pin
      appId:(NSString*)appId
      sequenceNumber:(NSString*)sequenceNumber
      templateId:(NSString*)templateId
      mobileNum:(NSString*)mobileNum
      stateFlag:(NSNumber*)stateFlag
      sendTime:(NSString*)sendTime { 
     self.pin = pin;               
     self.appId = appId;               
     self.sequenceNumber = sequenceNumber;               
     self.templateId = templateId;               
     self.mobileNum = mobileNum;               
     self.stateFlag = stateFlag;               
     self.sendTime = sendTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self pin])
    {
        [result setValue:[self pin] forKey:@"pin"];
    }
    if([self appId])
    {
        [result setValue:[self appId] forKey:@"appId"];
    }
    if([self sequenceNumber])
    {
        [result setValue:[self sequenceNumber] forKey:@"sequenceNumber"];
    }
    if([self templateId])
    {
        [result setValue:[self templateId] forKey:@"templateId"];
    }
    if([self mobileNum])
    {
        [result setValue:[self mobileNum] forKey:@"mobileNum"];
    }
    if([self stateFlag])
    {
        [result setValue:[self stateFlag] forKey:@"stateFlag"];
    }
    if([self sendTime])
    {
        [result setValue:[self sendTime] forKey:@"sendTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pin = [dictionary objectForKey:@"pin"];
    self.appId = [dictionary objectForKey:@"appId"];
    self.sequenceNumber = [dictionary objectForKey:@"sequenceNumber"];
    self.templateId = [dictionary objectForKey:@"templateId"];
    self.mobileNum = [dictionary objectForKey:@"mobileNum"];
    self.stateFlag = [dictionary objectForKey:@"stateFlag"];
    self.sendTime = [dictionary objectForKey:@"sendTime"];
    return self;
}
 @end
@implementation SendBatchMsg
-(id) initWithSequenceNumber:(NSString*) sequenceNumber { 
     self.sequenceNumber = sequenceNumber;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self sequenceNumber])
    {
        [result setValue:[self sequenceNumber] forKey:@"sequenceNumber"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.sequenceNumber = [dictionary objectForKey:@"sequenceNumber"];
    return self;
}
 @end
@implementation RespQueryTemplateListData
-(id) initWithTemplateId:(NSString*) templateId
      title:(NSString*)title
      status:(NSString*)status
      reason:(NSString*)reason
      createTime:(NSString*)createTime
      contentSize:(NSString*)contentSize
      aptitudesId:(NSString*)aptitudesId
      descriptionValue:(NSString*)descriptionValue { 
     self.templateId = templateId;               
     self.title = title;               
     self.status = status;               
     self.reason = reason;               
     self.createTime = createTime;               
     self.contentSize = contentSize;               
     self.aptitudesId = aptitudesId;               
     self.descriptionValue = descriptionValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self templateId])
    {
        [result setValue:[self templateId] forKey:@"templateId"];
    }
    if([self title])
    {
        [result setValue:[self title] forKey:@"title"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self reason])
    {
        [result setValue:[self reason] forKey:@"reason"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self contentSize])
    {
        [result setValue:[self contentSize] forKey:@"contentSize"];
    }
    if([self aptitudesId])
    {
        [result setValue:[self aptitudesId] forKey:@"aptitudesId"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.templateId = [dictionary objectForKey:@"templateId"];
    self.title = [dictionary objectForKey:@"title"];
    self.status = [dictionary objectForKey:@"status"];
    self.reason = [dictionary objectForKey:@"reason"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.contentSize = [dictionary objectForKey:@"contentSize"];
    self.aptitudesId = [dictionary objectForKey:@"aptitudesId"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    return self;
}
 @end
@implementation TemplateContent
-(id) initWithFileType:(NSString*) fileType
      value:(NSString*)value { 
     self.fileType = fileType;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self fileType])
    {
        [result setValue:[self fileType] forKey:@"fileType"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.fileType = [dictionary objectForKey:@"fileType"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation RespTemplateData
-(id) initWithTemplateId:(NSString*) templateId { 
     self.templateId = templateId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self templateId])
    {
        [result setValue:[self templateId] forKey:@"templateId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.templateId = [dictionary objectForKey:@"templateId"];
    return self;
}
 @end
@implementation RespPackageResult
-(id) initWithRemainder:(NSNumber*) remainder { 
     self.remainder = remainder;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self remainder])
    {
        [result setValue:[self remainder] forKey:@"remainder"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.remainder = [dictionary objectForKey:@"remainder"];
    return self;
}
 @end
@implementation QuerySendStatus
-(id) initWithTotal:(NSNumber*) total
      detailList:(NSArray<SendStatus*>*)detailList { 
     self.total = total;               
     self.detailList = detailList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self total])
    {
        [result setValue:[self total] forKey:@"total"];
    }
    if([self detailList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self detailList] count]; i++) {
            SendStatus* item = [[self detailList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"detailList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.total = [dictionary objectForKey:@"total"];
    NSArray* detailListArray = [dictionary objectForKey:@"detailList"];
    if(detailListArray&&![detailListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [detailListArray count];i++)
        {
            SendStatus* item = [[SendStatus alloc]initWithDic:[detailListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.detailList = propertyArray;
    }
    return self;
}
 @end
@implementation RespTemplatePageResult
-(id) initWithCount:(NSNumber*) count
      pageNum:(NSNumber*)pageNum
      pageSize:(NSNumber*)pageSize
      pageCount:(NSNumber*)pageCount
      list:(NSArray<RespQueryTemplateListData*>*)list { 
     self.count = count;               
     self.pageNum = pageNum;               
     self.pageSize = pageSize;               
     self.pageCount = pageCount;               
     self.list = list;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    if([self pageNum])
    {
        [result setValue:[self pageNum] forKey:@"pageNum"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self pageCount])
    {
        [result setValue:[self pageCount] forKey:@"pageCount"];
    }
    if([self list])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self list] count]; i++) {
            RespQueryTemplateListData* item = [[self list] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"list"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.count = [dictionary objectForKey:@"count"];
    self.pageNum = [dictionary objectForKey:@"pageNum"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.pageCount = [dictionary objectForKey:@"pageCount"];
    NSArray* listArray = [dictionary objectForKey:@"list"];
    if(listArray&&![listArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [listArray count];i++)
        {
            RespQueryTemplateListData* item = [[RespQueryTemplateListData alloc]initWithDic:[listArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.list = propertyArray;
    }
    return self;
}
 @end
 
 


